Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IIIF validation #45

Merged
merged 6 commits into from
Nov 18, 2024
Merged

IIIF validation #45

merged 6 commits into from
Nov 18, 2024

Conversation

camdendotlol
Copy link
Collaborator

@camdendotlol camdendotlol commented Nov 15, 2024

Summary

  • adds a bunch of checking for null values and array length throughout the iiif.js script to make sure we're getting the data we need to properly generate the TEI file
    • some of these checks address potential crashes (e.g. accessing the first element of an array that might be empty) while others focus more on user error (e.g. undefined labels and empty item arrays)
  • adds newlines and indentation between each surface element so they're no longer all printed on one line
  • updates the TEI template used by the iiif script to wrap the contents in a div

Notes

We have to be really careful here because there's so much variation in how IIIF manifests can look - we don't want to error out on a valid manifest. So this PR takes a pretty minimalist approach to these checks and doesn't attempt to fully validate the manifest against the IIIF standard. I've tested with a wide range of manifests with both versions of the Presentation API and they all worked, but it might be worth testing more widely before a production release.

@camdendotlol camdendotlol marked this pull request as ready for review November 18, 2024 15:58
Copy link
Collaborator

@NickLaiacona NickLaiacona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

@camdendotlol camdendotlol merged commit 115dd26 into dev Nov 18, 2024
@camdendotlol camdendotlol deleted the cm/iiif-validation branch November 18, 2024 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants